package com.gt.quality.system.mapper;

import com.gt.quality.config.handler.EasyBaseMapper;
import com.gt.quality.system.entity.SysMenu;
import com.gt.quality.system.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 菜单权限表(SysMenu)表数据库访问层
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
@Mapper
@SuppressWarnings("all")
public interface SysMenuMapper extends EasyBaseMapper<SysMenu> {

    @Select("""
          <script>
            select main.* from sys_menu main left join sys_role_menu srm on srm.menu_id = main.menu_id 
            where  srm.role_id in
            <foreach item='roleId' index='index' collection='listData' open='(' separator=',' close=')'>
             #{roleId}
            </foreach>
            </script>
      
    """)
    List<SysMenu> selectByRoleIds(@Param("listData") List<SysRole> list);
}

